import { Button, message, Popconfirm, Input, Select } from 'antd';
import React, { useState, useRef, useEffect } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import _ from 'lodash';
import request from '@/utils/request';
import apiPath from '@/utils/apiPath.js';
// import { TcPlayer } from "tcplayer";

const PageContent = () => {

  useEffect(() => {
    // var player = new TcPlayer("id_test_video", {
    //   // m3u8: "http://pull.livetest.maizs.top/live/10023.m3u8", //请替换成实际可用的播放地址
    //   flv: "http://pull.livetest.maizs.top/live/10023.flv",
    //   // rtmp: "rtmp://pull.livetest.maizs.top/livetest/liveteststreat",
    //   autoplay: true, //iOS 下 safari 浏览器，以及大部分移动端浏览器是不开放视频自动播放这个能力的
    //   poster: "",
    //   width: "480", //视频的显示宽度，请尽量使用视频分辨率宽度
    //   height: "320" //视频的显示高度，请尽量使用视频分辨率高度
    // });
    if (flvjs.isSupported()) {
      var videoElement = document.getElementById('videoElement');
      var flvPlayer = flvjs.createPlayer({
          type: 'flv',
          url: 'http://example.com/flv/video.flv'
      });
      flvPlayer.attachMediaElement(videoElement);
      flvPlayer.load();
      flvPlayer.play();
  }
  })

  return (
    <PageContainer>
      {/* <div id="id_test_video">
      </div> */}
    </PageContainer>
  );
};

export default PageContent;
